Skip to content

fix: Avoid cycle when lowering predicates for associated item lookup #10456

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 4, 2021
Merged

fix: Avoid cycle when lowering predicates for associated item lookup #10456

merged 1 commit into from
Oct 4, 2021

Conversation

jonas-schievink
Copy link
Contributor

Fixes #10386

(the salsa bug persists, but this lets us avoid it by fixing the underlying bug)

This reimplements the rustc logic in https://github.com/rust-lang/rust/blob/b27661eb33c74cb514dba059b47d86b6582ac1c2/compiler/rustc_typeck/src/collect.rs#L556: When resolving an associated type T::Item, we've previously lowered all predicates that could affect T, but we actually have to look only at those predicates whose traits define an associated type of the right name.

@jonas-schievink jonas-schievink changed the title Avoid cycle when lowering predicates for associated item lookup fix: Avoid cycle when lowering predicates for associated item lookup Oct 4, 2021
@flodiebold
Copy link
Member

Oh, it looks like that logic was added more recently than our associated type selection code 😅

bors r+

@bors
Copy link
Contributor

bors bot commented Oct 4, 2021

@bors bors bot merged commit 5bdae82 into rust-lang:master Oct 4, 2021
@jonas-schievink jonas-schievink deleted the fix-assoc-shorthand-pred-cycle branch October 4, 2021 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'called Option::unwrap() on a None value' when editing KAS GUI applications
2 participants